/**
 * @(#)MigrationController.java, 2010-5-16. 
 * 
 * Copyright 2010 Youdao, Inc. All rights reserved.
 * YOUDAO PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
 */
package com.rsstuan.web.backend.controller;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.springframework.web.servlet.ModelAndView;

import com.rsstuan.experiment.tool.DataMigrationTool;
import com.rsstuan.web.controller.SpringController;

/**
 *
 * @author guosq
 *
 */
public class MigrationController extends SpringController {
    
    private DataMigrationTool tool = new DataMigrationTool();
    
    public ModelAndView migrateSite(HttpServletRequest request,
            HttpServletResponse response) {
        try {
            tool.migrateSite();
            response.getWriter().println("Migrate Sites Successfull");
            return null;
        } catch (Exception e) {
            return null;
        }
    }
    
    public ModelAndView migrateChannel(HttpServletRequest request,
            HttpServletResponse response) {
        try {
            tool.migrateChannels();
            response.getWriter().println("Migrate Channels Successfull");
            return null;
        } catch (Exception e) {
            return null;
        }
    }

    
}
